//
//  CTReachability.m
//  ConstellationTalk_0.1
//
//  Created by riley on 15/4/6.
//  Copyright (c) 2015年 Suberverter. All rights reserved.
//

#import "CTReachability.h"
#import "AFNetworkReachabilityManager.h"


static CTNetWorkReachabilityStatus currentNetWorkStatus = CTNetWorkReachabilityStatusReachableViaWiFi;


@implementation CTReachability


#pragma mark - 检测网络状态 -
+(CTNetWorkReachabilityStatus)judegeCurrentNetWorkStatus
{
    
    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
    
    [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        switch (status) {
            case AFNetworkReachabilityStatusNotReachable:
                currentNetWorkStatus = CTNetWorkReachabilityStatusNotReachable;
                break;
            case AFNetworkReachabilityStatusReachableViaWiFi:
                currentNetWorkStatus = CTNetWorkReachabilityStatusReachableViaWiFi;
                break;
            case AFNetworkReachabilityStatusReachableViaWWAN:
                currentNetWorkStatus = CTNetWorkReachabilityStatusReachableViaWWAN;
                break;
            case AFNetworkReachabilityStatusUnknown:
                currentNetWorkStatus = CTNetWorkReachabilityStatusUnknown;
                break;
            default:
                break;
        }
     
    }];
    
    return currentNetWorkStatus;
}



@end
